<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>管理员登录</title>
    <link rel="stylesheet" href="//unpkg.com/layui@2.6.8/dist/css/layui.css">
    <script src="https://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
    <script th:src="@{/other/check.js}"></script>
</head>
<body>
<div class="login-main" style="width: 1500px;height: auto;margin-left: auto;margin-right: auto">
    <img th:src="@{/images/logo.png}" style="margin-left: 15%">
    <div style="margin-top: 200px">
        <h1 class="layui-elip" style="margin-left: 690px;">管理员登录</h1>
        <form class="layui-form" style="margin-left: auto;margin-right: auto;width: 500px">
            <div class="layui-input-inline">
                <input id="tel" onblur="checkTel()" type="text" name="tel" required lay-verify="required" placeholder="手机号" class="layui-input" autocomplete="off" style="height:45px;margin-top: 15px;width: 350px;margin-left: 80px;font-size: 18px">
            </div><br>
            <div class="layui-input-inline">
                <input id="pass" onblur="passwordCheck()" type="password" name="password" required lay-verify="required" placeholder="密码" class="layui-input" autocomplete="off" style="height:45px;margin-top: 30px;width: 350px;margin-left: 80px;font-size: 18px">
            </div><br>
            <div class="layui-input-inline login-btn" style="margin-top: 20px">
                <button lay-submit lay-filter="login" 	class="layui-btn layui-btn-lg layui-btn-radius layui-btn-normal layui-anim-scalesmall" style="margin-left: 200px;margin-top: 15px;width: 100px">登录</button>
<!--                <a href="/index/register" class="layui-btn layui-btn-lg layui-btn-radius layui-btn-danger layui-anim-scalesmall" style="margin-left: 80px;margin-top: 15px;width: 100px">新用户</a>-->
            </div>
        </form>
    </div>

    <footer style="margin-top: 200px;margin-left: 45%">Copyright© Design By leileiMann</footer>
</div>

<script src="//unpkg.com/layui@2.6.8/dist/layui.js"></script>
<script>
    layui.use("form",function () {
        var form = layui.form;
        var $ = layui.$;
        //监听提交
        form.on("submit(login)",function (data) {
            $.ajax({
                url:"/admin/toALogin",
                type:"POST",
                data:data.field,
                dataType:"json",
                success: function (result) {
                    if(result.code == "1"){
                        layer.msg(result.msg,{icon:result.icon,anim:result.anim},function () {
                            location.href = '/index/SSpotManger';    //登录成功，转向管理员的主页
                        });
                    }else{
                        layer.msg(result.msg,{icon:result.icon,anim:result.anim});
                    }
                }
            });
            return false;
        });
    });
</script>
</body>
</html>
















